/**
 * 20080305 1527: Eric Kao was created.
 */

package jdbc.mssql;

import java.sql.Connection;

import com.e885.exception.E885DBException;
import com.e885.jdbc.JDBCUtil;
import com.e885.jdbc.MSSQLJDBC;
import com.e885.log.E885Logger;

/**
 * 測試取得 MSSQL connection <br>
 * Copyright: Copyright (c) 2001-2008<br>
 * Company: E885 Group
 * 
 * @author Eric.Kao(gau168.gau@msa.hinet.net)
 * @version 1.0
 */
public class GetConnection
{
	private String ip = MSSQLInfo.IP;

	private int port = MSSQLInfo.PORT;

	private String userName = MSSQLInfo.USER_NAME;

	private String password = MSSQLInfo.PASSWORD;

	private String databaseName = MSSQLInfo.DATABASE_NAME;

	public GetConnection() throws E885DBException
	{
		JDBCUtil util = new MSSQLJDBC( ip, port, userName, password, databaseName );

		Connection connection = util.getConnection();

		E885Logger.testLog.debug( "connection:" + connection );
	}

	public static void main( String[] args )
	{
		try
		{
			new GetConnection();
		}
		catch( E885DBException ex )
		{
			ex.printStackTrace();
		}
	}
}
